{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/design-hashset\n",
    "\n",
    "\n",
    "Runtime: 36 ms, faster than 41.67% of Rust online submissions for Design HashSet.\n",
    "Memory Usage: 5.6 MB, less than 70.83% of Rust online submissions for Design HashSet.\n",
    "\n",
    "\n",
    "```rust\n",
    "use std::collections::HashSet;\n",
    "\n",
    "struct MyHashSet {\n",
    "    set:HashSet<i32>,\n",
    "}\n",
    "\n",
    "impl MyHashSet {\n",
    "\n",
    "    /** Initialize your data structure here. */\n",
    "    fn new() -> Self {\n",
    "        return MyHashSet{\n",
    "            set: HashSet::new()\n",
    "        }\n",
    "    }\n",
    "    \n",
    "    fn add(& mut self, key: i32) {\n",
    "        self.set.insert(key);\n",
    "    }\n",
    "    \n",
    "    fn remove(& mut self, key: i32) {\n",
    "        self.set.remove(&key);\n",
    "    }\n",
    "    \n",
    "    /** Returns true if this set contains the specified element */\n",
    "    fn contains(&self, key: i32) -> bool {\n",
    "        return self.set.contains(&key);\n",
    "    }\n",
    "}\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Rust",
   "language": "rust",
   "name": "rust"
  },
  "language_info": {
   "codemirror_mode": "rust",
   "file_extension": ".rs",
   "mimetype": "text/rust",
   "name": "Rust",
   "pygment_lexer": "rust",
   "version": ""
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
